class BPlusTree {
	
	// this is the File object that actually stores the B+-Tree
	File whereILive;

	// this is the name of the file that actually stores the B+-Tree
	char *fileName;

	// this is the type of the key value that is stored in the tree
	Type keyType;

	// this is the number of pages in the tree
	int numPages;

	// this is the height of the tree
	int height;

	// this is the ID of the page that contains the root of the tree
	int rootLocation;

public:

	// this returns a pointer to a sorted list of page IDs of length
	// numPagesReturned.  Each item in the list is the page number of 
	// a page in the binary database file indexed by the B+-Tree that has 
	// at least one record whose value is in the range lowVal to hiVal.
	// The list of pages should have no duplictes -- that is, if a given
	// page in the data file has two data records that fall on the 
	// specified range, the page number should still appear only once.
	// Note that numPagesReturned is both an input parameter and an output
	// parameter.  The value input by the caller is the maximum number of
	// page IDs to return, no matter how may pages have matching data.
	// If more pages in the binary database file have matching data, then
	// an arbitrary subset of size numPagesReturned should be returned.
	// The value returned in numPagesReturned is the *actual* number of
	// page IDs in the returned array; typically, this will be smaller 
	// than the value of numPagesReturned that is input into the function.
	int *SearchKeyRange (int &numPagesReturned, Attribute &lowVal, 
		Attribute &highVal);

	// this inserts a new (key, pointer) pair into the tree
	void Insert (char *keyVal, int pageID);

	// this opens up an already existing tree; the actual binary file that
	// stores the tree is located in the file named as the input parameter.
	// Also, it is assumed that there is a text file of the same name, 
	// except that it has the extension ".info" that contains all of the
	// important information that the tree needs to open up an
	// already-existing tree file.  The suggested format is:
	//
	// keyType: Int
	// numPages: 27
	// height: 3
	// rootLocation: 13
	//
	// For example, say that fName = "myTree".  Then the file "myTree" 
	// would hold a binary database file that stores the tree, and the file
	// "myTree.info" would have a text file, four lines long, that gives 
	// the key type for the tree, the number of pages in the tree, the
	// height of the tree, and the page number for the root.
	// 
	// The return value is a 1 on success, and a 0 on failure.
	int Open (char *fName);

	// this creates a brand new B+-Tree.  It will be stored at the location
	// indicated by the parameter, and it will store (key, ptr) pairs where
	// the key is of the type indicated.
	int Create (char *fName, Type keyType);

	// this is the destructor.  The destructor should close whereILive,
	// and then write out the correpsonding ".info" file so that the tree
	// can be opened up once again at some future time.
	~BPlusTree ();

	// this is the constructor.
	BPlusTree ();
};

